<!DOCTYPE html>
<html>
<head>
    <title>床位数据库</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">

    <!-- Bootstrap -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <!--<link href="/static/css/font-awesome.min.css" rel="stylesheet" media="screen">-->
    <link href="/static/css/style_admin.css" rel="stylesheet" type="text/css">
    <link type="text/css" rel="stylesheet" media="all" href="/static/css/global.css" />
    <link type="text/css" rel="stylesheet" media="all" href="/static/css/global_color.css" />
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--JavaScript-->


    <script language="javascript" type="text/javascript">
    //获取床位数据
    $(function () {
    var tel = {{.tel}}
    $(document).ready(function() {
     $.getJSON('http://'+window.location.host+'/bed/add', function(data) {

        	$.each(data.BedID,function(index,element){
				    $("#datalist").append('<tr><td><input type="checkbox" /></td><td>'+element.BedID+'</td><td>'+RoomID+'</td><td>'+element.Department+'</td><td>'+element.Msg+'</td><td>'+element.Address+'</td><td>'+element.IsLogin+'</td><td class="td_modi"><input type="button" value="修改" class="btn_modify" onclick="location.href='admin_modi.html';" /><input type="button" value="删除" class="btn_delete" onclick="deleteAdmin();" /></td></tr>')

			});
    	});

    });

});

        //显示角色详细信息
        function showDetail(flag, a) {
            var detailDiv = a.parentNode.getElementsByTagName("div")[0];
            if (flag) {
                detailDiv.style.display = "block";
            }
            else
                detailDiv.style.display = "none";
        }

        //删除
        function deleteAdmin() {
            var r = window.confirm("确定要删除此床位吗？");
            document.getElementById("operate_result_info").style.display = "block";
        }
        //全选
        function selectAdmins(inputObj) {
            var inputArray = document.getElementById("datalist").getElementsByTagName("input");
            for (var i = 1; i < inputArray.length; i++) {
                if (inputArray[i].type == "checkbox") {
                    inputArray[i].checked = inputObj.checked;
                }
            }
        }
    </script>

    <script src="/static/js/jquery-1.9.1.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>

    <!--[if lt IE 9]>
    <script src="/static/js/html5shiv.js"></script>
    <script src="/static/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<!-- HTML start-->
<!--side start-->
<div class="side">
    <div class="logo">功能</div>
    <div class="sidemenu">
        <ul>
            <li>
                <a href="/admin/show_admin_index/{{.UserID}}">
                    <i class="ico i-nav1"></i>
                    <p>主界面</p>
                </a>
            </li>
            <li>
                <a href="/admin/show_admins_list/{{.UserID}}">
                    <i class="ico i-nav3"></i>
                    <p>用户数据库</p>
                </a>
            </li>
            <li>
                <a href="/admin/show_beds_list/{{.UserID}}">
                    <i class="ico i-nav2"></i>
                    <p>床位数据库</p>
                </a>
            </li>
            <li>
                <a href="/admin/show_rooms_list/{{.UserID}}">
                    <i class="ico i-nav5"></i>
                    <p>房间数据库</p>
                </a>
            </li>
            <li  style="background-color: #666666;">
                <a href="/admin/show_departments_list/{{.UserID}}">
                    <i class="ico i-nav4"></i>
                    <p>部门数据库</p>
                </a>
            </li>
            <li>
                <a href="/admin/index/{{.UserID}}">
                    <i class="ico i-nav8"></i>
                    <p>监控页面</p>
                </a>
            </li>
            <li>
                <a href="/admin/logout/{{.UserID}}">
                    <i class="ico i-nav7"></i>
                    <p>退出登入</p>
                </a>
            </li>
        </ul>
    </div>
</div>
<!--side end -->
<!--header start-->
<div class="header clear">
    <div class="date-cont1 left">
        <span class="time">17:36</span>
        <p class="date">2015-09-02</p>
    </div>


    <div class="dropdown right head-dropdown">
        <a class="under-n head-droplink" id="dropdownMenu1" data-toggle="dropdown" >
            <span class="avtar"><img src="/static/img/avtar.jpg" ></span>
            Admin
            <i class="fa fa-chevron-down"></i>
        </a>
    </div>
</div>
<!--header end -->
<!--main start-->
<div class="main">
    <div class="pad20">
        <div id="main-index">
            <div class="main-top">
                <p>部门数据库</p>
            </div>
            <form action="" method="">
                <!--查询-->
                <div class="search_add">
                    <div>
                        模块：
                        <select id="selModules" class="select_search">
                            <option>部门</option>
                            <option>儿科</option>
                            <option>妇科</option>
                            <option>x科</option>
                            <option>xx科</option>
                        </select>
                    </div>
                    <!--<div>床位号：<input type="text" value="" class="text_search width200" /></div>-->
                    <div><input type="button" value="搜索" class="btn_search"/></div>
                    <div>
                        <!--<input type="button" value="密码重置" class="btn_add" onclick="resetPwd();" />-->
                        <input type="button" value="添加部门" class="btn_add" onclick="location.href='/bed/addbeds';" />
                    </div>
                </div>
                <!--删除和密码重置的操作提示-->
                <div id="operate_result_info" class="operate_fail">
                    <img src="/static/img/close.png" onclick="this.parentNode.style.display='none';" />
                    <span>删除失败！数据并发错误。</span><!--密码重置失败！数据并发错误。-->
                </div>
                <!--数据区域：用表格展示数据-->
                <div id="data">
                    <table id="datalist">
                        <tr>
                            <th class="th_select_all" style="width: 5%;">
                                <input type="checkbox" onclick="selectAdmins(this);" />
                                <span>全选</span>
                            </th>
                            <th style="width: 10%;">部门ID</th>
                            <!--<th style="width: 10%;">房间号</th>-->
                            <th style="width: 10%;">部门</th>
                            <th style="width: 20%;">详细信息</th>
                            <!--<th style="width: 20%;">地址</th>-->
                            <th style="width: 5%;">是否在线</th>
                            <th style="width: 10%;">操作</th>
                        </tr>
                    </table>
                </div>
                <!--分页-->
                <div id="pages">
                    <a href="#">上一页</a>
                    <a href="#" class="current_page">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                    <a href="#">4</a>
                    <a href="#">5</a>
                    <a href="#">下一页</a>
                </div>
            </form>
        </div>




    </div>

</div>
<!--main end-->
</body>
</html>